package com.gudaichaoren.pipelinevalve;

import com.gudaichaoren.pipelinevalve.pipeline.impl.InstallCarPipeline;
import com.gudaichaoren.pipelinevalve.valve.impl.InstallEngineValve;
import com.gudaichaoren.pipelinevalve.valve.impl.InstallWindowsValve;
import com.gudaichaoren.pipelinevalve.valve.impl.QualityInspectionValve;
import com.gudaichaoren.pipelinevalve.valve.impl.SprayPaintValve;

public class test {
    public static void main(String[] args) {
        //创建pipeline管道
        InstallCarPipeline installCarPipeline = new InstallCarPipeline();
        //创建多个valve阀门
        InstallEngineValve installEngineValve = new InstallEngineValve();
        InstallWindowsValve installWindowsValve = new InstallWindowsValve();
        SprayPaintValve sprayPaintValve = new SprayPaintValve();
        QualityInspectionValve qualityInspectionValve = new QualityInspectionValve();
        //阀门装入管道中
        installCarPipeline.addValve(installEngineValve);
        installCarPipeline.addValve(installWindowsValve);
        installCarPipeline.addValve(sprayPaintValve);
        installCarPipeline.setBasic(qualityInspectionValve);
        //管道程序执行
        installCarPipeline.invoke(true);
    }
}
